<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The EventDnsBase class</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="eventconfig.setmaxdispatchinterval.html">EventConfig::setMaxDispatchInterval</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="eventdnsbase.addnameserverip.html">EventDnsBase::addNameserverIp</a></div>
 <div class="up"><a href="book.event.html">Event</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.eventdnsbase" class="reference">
 <h1 class="title">The EventDnsBase class</h1>
 
 <div class="partintro"><p class="verinfo">(PECL event &gt;= 1.2.6-beta)</p>

  <div class="section" id="eventdnsbase.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    Represents Libevent&#039;s DNS base structure. Used to resolve DNS
    asyncronously, parse configuration files like resolv.conf etc.
   </p>
  </div>

  <div class="section" id="eventdnsbase.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass">
     
    </div>

    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">final</span>
      <strong class="classname">EventDnsBase</strong>
     </span>
     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Constants */</div>
    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.eventdnsbase.html#eventdnsbase.constants.option-search"><var class="varname">OPTION_SEARCH</var></a></var>
     <span class="initializer"> = 1</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.eventdnsbase.html#eventdnsbase.constants.option-nameservers"><var class="varname">OPTION_NAMESERVERS</var></a></var>
     <span class="initializer"> = 2</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.eventdnsbase.html#eventdnsbase.constants.option-misc"><var class="varname">OPTION_MISC</var></a></var>
     <span class="initializer"> = 4</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.eventdnsbase.html#eventdnsbase.constants.option-hostsfile"><var class="varname">OPTION_HOSTSFILE</var></a></var>
     <span class="initializer"> = 8</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.eventdnsbase.html#eventdnsbase.constants.options-all"><var class="varname">OPTIONS_ALL</var></a></var>
     <span class="initializer"> = 15</span>
    ;</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">bool</span>
   <span class="methodname"><a href="eventdnsbase.addnameserverip.html" class="methodname">addNameserverIp</a></span>
    ( <span class="methodparam">
    <span class="type">string</span>
     <code class="parameter">$ip</code>
   </span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">void</span>
   <span class="methodname"><a href="eventdnsbase.addsearch.html" class="methodname">addSearch</a></span>
    ( <span class="methodparam">
    <span class="type">string</span>
     <code class="parameter">$domain</code>
   </span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">void</span>
   <span class="methodname"><a href="eventdnsbase.clearsearch.html" class="methodname">clearSearch</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="methodname"><a href="eventdnsbase.construct.html" class="methodname">__construct</a></span>
    ( <span class="methodparam">
    <span class="type"><a href="class.eventbase.html" class="type EventBase">EventBase</a></span>
     <code class="parameter">$base</code>
   </span>
   , <span class="methodparam">
    <span class="type">bool</span>
     <code class="parameter">$initialize</code>
   </span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">void</span>
   <span class="methodname"><a href="eventdnsbase.countnameservers.html" class="methodname">countNameservers</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">bool</span>
   <span class="methodname"><a href="eventdnsbase.loadhosts.html" class="methodname">loadHosts</a></span>
    ( <span class="methodparam">
    <span class="type">string</span>
     <code class="parameter">$hosts</code>
   </span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">bool</span>
   <span class="methodname"><a href="eventdnsbase.parseresolvconf.html" class="methodname">parseResolvConf</a></span>
    ( <span class="methodparam">
    <span class="type">int</span>
     <code class="parameter">$flags</code>
   </span>
   , <span class="methodparam">
    <span class="type">string</span>
     <code class="parameter">$filename</code>
   </span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">bool</span>
   <span class="methodname"><a href="eventdnsbase.setoption.html" class="methodname">setOption</a></span>
    ( <span class="methodparam">
    <span class="type">string</span>
     <code class="parameter">$option</code>
   </span>
   , <span class="methodparam">
    <span class="type">string</span>
     <code class="parameter">$value</code>
   </span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">bool</span>
   <span class="methodname"><a href="eventdnsbase.setsearchndots.html" class="methodname">setSearchNdots</a></span>
    ( <span class="methodparam">
    <span class="type">int</span>
     <code class="parameter">$ndots</code>
   </span>
   )</div>

   }</div>

  </div>

  <div class="section" id="eventdnsbase.constants">
   <h2 class="title">预定义常量</h2>
   <dl>

    
     <dt id="eventdnsbase.constants.option-search">
      <strong><code>EventDnsBase::OPTION_SEARCH</code></strong>
     </dt>

     <dd>

      <p class="para">
       Tells to read the domain and search fields from the
       <em>resolv.conf</em>
       file and the
       <em>ndots</em>
       option, and use them to decide which domains(if any) to search for
       hostnames that aren’t fully-qualified.
      </p>
     </dd>

    
    
     <dt id="eventdnsbase.constants.option-nameservers">
      <strong><code>EventDnsBase::OPTION_NAMESERVERS</code></strong>
     </dt>

     <dd>

      <p class="para">
       Tells to learn the nameservers from the
       <em>resolv.conf</em>
       file.
      </p>
     </dd>

    
    
     <dt id="eventdnsbase.constants.option-misc">
      <strong><code>EventDnsBase::OPTION_MISC</code></strong>
     </dt>

     <dd>

      <p class="para"/>
     </dd>

    
    
     <dt id="eventdnsbase.constants.option-hostsfile">
      <strong><code>EventDnsBase::OPTION_HOSTSFILE</code></strong>
     </dt>

     <dd>

      <p class="para">
       Tells to read a list of hosts from
       <em>/etc/hosts</em>
       as part of loading the
       <em>resolv.conf</em>
       file.
      </p>
     </dd>

    
    
     <dt id="eventdnsbase.constants.options-all">
      <strong><code>EventDnsBase::OPTIONS_ALL</code></strong>
     </dt>

     <dd>

      <p class="para">
       Tells to learn as much as it can from the
       <em>resolv.conf</em>
       file.
      </p>
     </dd>

    
   </dl>

  </div>

 </div>

 














































<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="eventdnsbase.addnameserverip.html">EventDnsBase::addNameserverIp</a> — Adds a nameserver to the DNS base</li><li><a href="eventdnsbase.addsearch.html">EventDnsBase::addSearch</a> — Adds a domain to the list of search domains</li><li><a href="eventdnsbase.clearsearch.html">EventDnsBase::clearSearch</a> — Removes all current search suffixes</li><li><a href="eventdnsbase.construct.html">EventDnsBase::__construct</a> — Constructs EventDnsBase object</li><li><a href="eventdnsbase.countnameservers.html">EventDnsBase::countNameservers</a> — Gets the number of configured nameservers</li><li><a href="eventdnsbase.loadhosts.html">EventDnsBase::loadHosts</a> — Loads a hosts file (in the same format as /etc/hosts) from hosts file</li><li><a href="eventdnsbase.parseresolvconf.html">EventDnsBase::parseResolvConf</a> — Scans the resolv.conf-formatted file</li><li><a href="eventdnsbase.setoption.html">EventDnsBase::setOption</a> — Set the value of a configuration option</li><li><a href="eventdnsbase.setsearchndots.html">EventDnsBase::setSearchNdots</a> — Set the 'ndots' parameter for searches</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="eventconfig.setmaxdispatchinterval.html">EventConfig::setMaxDispatchInterval</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="eventdnsbase.addnameserverip.html">EventDnsBase::addNameserverIp</a></div>
 <div class="up"><a href="book.event.html">Event</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
